<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <button @click="add">点我++</button>
    <button @click="findUsers">点我查询所有用户</button>
    <hr>
    <table border="1px">
        <tr>
            <td>id</td>
            <td>username</td>
            <td>password</td>
            <td>name</td>
            <td>age</td>
            <td>email</td>
        </tr>
        <tr v-for="user in users">
            <td>{{user.id}}</td>
            <td>{{user.userName}}</td>
            <td>{{user.password}}</td>
            <td>{{user.name}}</td>
            <td>{{user.age}}</td>
            <td>{{user.email}}</td>
        </tr>
    </table>
</div>
</body>
<script src="./vue/dist/vue.js"></script>
<script src="./axios/dist/axios.js"></script>
<script>
        new Vue({
            el:"#app",
            data: {
                users:[]
            },
            methods:{
                add(){
                    //请求后台的接口/路径
                    axios.get("/student/show")
                        .then((resp)=>{
                            console.log(resp)
                        })
                },
                findUsers(){
                    axios.get("/user/findAll")
                        .then((resp)=>{
                            this.users=resp.data;
                        })
                }

            }
        })
</script>
</html>